package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.EnvironmentalCoursesMapper;
import com.ruoyi.system.domain.EnvironmentalCourses;
import com.ruoyi.system.service.IEnvironmentalCoursesService;

/**
 * coursesService业务层处理
 * 
 * @author zrj
 * @date 2025-07-12
 */
@Service
public class EnvironmentalCoursesServiceImpl implements IEnvironmentalCoursesService 
{
    @Autowired
    private EnvironmentalCoursesMapper environmentalCoursesMapper;

    /**
     * 查询courses
     * 
     * @param courseId courses主键
     * @return courses
     */
    @Override
    public EnvironmentalCourses selectEnvironmentalCoursesByCourseId(Long courseId)
    {
        return environmentalCoursesMapper.selectEnvironmentalCoursesByCourseId(courseId);
    }

    /**
     * 查询courses列表
     * 
     * @param environmentalCourses courses
     * @return courses
     */
    @Override
    public List<EnvironmentalCourses> selectEnvironmentalCoursesList(EnvironmentalCourses environmentalCourses)
    {
        return environmentalCoursesMapper.selectEnvironmentalCoursesList(environmentalCourses);
    }

    /**
     * 新增courses
     * 
     * @param environmentalCourses courses
     * @return 结果
     */
    @Override
    public int insertEnvironmentalCourses(EnvironmentalCourses environmentalCourses)
    {
        environmentalCourses.setCreateTime(DateUtils.getNowDate());
        return environmentalCoursesMapper.insertEnvironmentalCourses(environmentalCourses);
    }

    /**
     * 修改courses
     * 
     * @param environmentalCourses courses
     * @return 结果
     */
    @Override
    public int updateEnvironmentalCourses(EnvironmentalCourses environmentalCourses)
    {
        environmentalCourses.setUpdateTime(DateUtils.getNowDate());
        return environmentalCoursesMapper.updateEnvironmentalCourses(environmentalCourses);
    }

    /**
     * 批量删除courses
     * 
     * @param courseIds 需要删除的courses主键
     * @return 结果
     */
    @Override
    public int deleteEnvironmentalCoursesByCourseIds(Long[] courseIds)
    {
        return environmentalCoursesMapper.deleteEnvironmentalCoursesByCourseIds(courseIds);
    }

    /**
     * 删除courses信息
     * 
     * @param courseId courses主键
     * @return 结果
     */
    @Override
    public int deleteEnvironmentalCoursesByCourseId(Long courseId)
    {
        return environmentalCoursesMapper.deleteEnvironmentalCoursesByCourseId(courseId);
    }
}
